//
//  FinanciersInformationCell.m
//  Kjs-iOS
//
//  Created by cfq on 16/6/3.
//  Copyright © 2016年 jmhz. All rights reserved.
//

#import "FinanciersInformationCell.h"

@implementation FinanciersInformationCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.contactAddrLab.adjustsFontSizeToFitWidth = YES;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(CGFloat)setFinanceInfo:(ItemInfo *)item
{
    CGFloat contentH ;
    self.contactNameLab.text = [NSString stringWithFormat:@"%@",item.contactName];
    self.contactTelLab.text = [NSString stringWithFormat:@"%@",item.contactTel];
    self.contactEmailLab.text = [NSString stringWithFormat:@"%@",item.contactEmail];
    self.contactAddrLab.text = [NSString stringWithFormat:@"%@-%@-%@",item.localProvince,item.localCity,item.localCounty];
    
    if ([item.type isEqualToString:@"p"]) {
        self.companyNameLab.hidden = YES;
        self.companyInfoLab.hidden = YES;
        self.companyNameTitleLab.hidden = YES;
        self.companyInfoTitleLab.hidden = YES;
        //cell高度适应
        contentH = self.contactAddrLab.frame.size.height + self.contactAddrLab.frame.origin.y ;
    }else if([item.type isEqualToString:@"o"]){
        self.companyNameLab.hidden = NO;
        self.companyInfoLab.hidden = NO;
        self.companyNameTitleLab.hidden = NO;
        self.companyInfoTitleLab.hidden = NO;
        self.companyNameLab.text = item.companyName;
        self.companyInfoLab.text = item.teamIntroduction;
        self.companyInfoLab.numberOfLines = 0;
        [self.companyInfoLab sizeToFit];
        //cell高度适应
        contentH = self.companyInfoLab.frame.size.height + self.companyInfoLab.frame.origin.y;
    }
    return contentH;
}

@end
